You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed bug where the Money Home Card "Avail. balance" was being converted incorrectly using the user's selected fiat currency. This fix removes the USD conversion of the Card balance when the primaryToken is the Money account/vmUSD token.
Changelog
CHANGELOG entry: fixed Card balance on Money Home to be in USD
Feature: Money Home Card available balanceScenario: user views Card balance with a non-USD preferred currencyGiven the user has a Card balance and a non-USD preferred fiat currency
When the user opens the Money Home screen
Then the Card available balance is displayed in USD
I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Selected Performance tags: None (no tests recommended)
Risk Level: medium
AI Confidence: 92%
click to see 🤖 AI reasoning details
E2E Test Selection:
The PR changes are confined to MoneyHomeView.tsx and its test file. The functional change is a bug fix in the cardBalanceUsd useMemo: previously it always converted the raw fiat number from the user's selected currency to USD via convertSelectedFiatToUsd; now it checks cardPrimaryToken?.isMoneyAccountEntry — if true, the raw fiat value is already in USD and is used directly (pass-through), otherwise the currency conversion is applied. This is a correctness fix for the MetaMask Card balance display on the Money home screen. The test file adds a new test case for Money Account entries and updates an existing test that previously expected $0.00 (fallback when rates unavailable) to now expect $90.00 (pass-through for Money Account entries). This change is entirely within the SmokeMoney domain (MetaMask Card home screen, balance display). No swap confirmations, network management, account management, browser, snaps, or onboarding flows are affected. SmokeMoney is the appropriate and sufficient tag. Per SmokeMoney tag description, SmokeSwap and SmokeConfirmations are only needed when the Card Add Funds or similar flows execute swaps — this change is only about balance display logic, not transaction execution.
Performance Test Selection:
The change is a conditional check in a useMemo hook that avoids an unnecessary currency conversion for Money Account entries. This is a minor computational optimization (skipping one function call) with no meaningful performance impact on rendering times, asset loading, or any other performance-sensitive flow. No performance test tags are warranted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed bug where the Money Home Card "Avail. balance" was being converted incorrectly using the user's selected fiat currency. This fix removes the USD conversion of the Card balance when the
primaryTokenis the Money account/vmUSD token.Changelog
CHANGELOG entry: fixed Card balance on Money Home to be in USD
Related issues
Fixes: MUSD-1175: MetaMask Card "Avail. balance" incorrectly changes based on preferred fiat currency
Manual testing steps
Screenshots/Recordings
Before
Card balance isn't pinned to USD.
musd-1175-card-balance-on-money-home-not-pinned-to-usd-before.mov
After
Card balance is pinned to USD regardless of user's preferred currency.
musd-1175-card-balance-on-money-home-not-pinned-to-usd.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist